package com.shensi.api.pay.client;

import com.shensi.api.pay.pojo.CustomerCardUseRecord;
import com.shensi.api.pay.pojo.PayOrder;
import com.shensi.api.pay.pojo.vo.RefundResultVO;
import com.shensi.common.core.constant.CloudConstant;

import com.shensi.api.pay.param.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @date 2023/11/13
 */
@FeignClient(name = CloudConstant.PAY_SERVER, path = "pos")
public interface PosRefundClient {


    /**
     * 查询24小时内最后一笔支付消费的订单
     *
     * @return
     */
    @GetMapping("getLastPaidConsumeOrder")
    public ResultData<PayOrder> getLastPaidConsumeOrder(@RequestParam("mobilePhone") String mobilePhone,
                                                        @RequestParam("stationId") Integer stationId,
                                                        @RequestParam(value = "consumerId",required = false) Integer consumerId);

    /**
     * 根据订单号查询
     *
     * @param orderNo
     * @param stationId
     * @return
     */
    @GetMapping("getOneOrder")
    public ResultData<PayOrder> getOneOrder(@RequestParam("orderNo") String orderNo,
                                            @RequestParam("stationId") Integer stationId);

    /**
     * 退款消费订单
     *
     * @return
     */
    @GetMapping("refundConsumeOrder")
    public ResultData<RefundResultVO> refundConsumeOrder(@RequestParam("orderId") Integer orderId,
                                                         @RequestParam("userId") Integer userId);

    /**
     * 查询24小时内最后一笔支付消费的订单
     *
     * @return
     */
    @GetMapping("getLastPaidRechargeOrder")
    public ResultData<CustomerCardUseRecord> getLastPaidRechargeOrder(@RequestParam("mobilePhone") String mobilePhone,
                                                                      @RequestParam("stationId") Integer stationId,
                                                                      @RequestParam(required = false,value = "consumerId") Integer consumerId);

    /**
     * 根据订单号查询充值订单
     *
     * @param orderNo
     * @param stationId
     * @return
     */
    @GetMapping("getOneRechargeOrder")
    public ResultData<CustomerCardUseRecord> getOneRechargeOrder(@RequestParam("orderNo") String orderNo,
                                                                 @RequestParam("stationId") Integer stationId);


    /**
     * 退款充值订单
     *
     * @return
     */
    @GetMapping("refundRechargeOrder")
    public ResultData<RefundResultVO> refundRechargeOrder(@RequestParam("orderId") Integer orderId,
                                                          @RequestParam("userId") Integer userId);

}
